<?php
/*
 * showAssigns File
 *
 * @link http://riedel-st.de
 * @author Stefan Riedel <sr@riedel-st.de>
*/
?>
<?php if(!empty($rbac)):?>
<h3><?=Yii::t('crm', 'Zuweisungen für - {user}', array('{user}' => $username))?></h3>
<table border="0" cellspacing="2" cellpadding="0" class="ui-widget-content ui-corner-all">
    <thead class="ui-widget-header">
        <tr>
            <th><?=Yii::t('crm', 'Name')?></th>
            <th><?=Yii::t('crm', 'Typ')?></th>
            <th><?=Yii::t('crm', 'Aktionen')?></th>
        </tr>
    </thead>
    <tr>
        <td valign="top" colspan="3">
            <table class="roles">
                    <?php
                    $k = 0;
                    foreach($rbac as $i=>$role):
                        $n = $k%2;
                        ?>
                <tr class="state-default<?=$n?>">
                    <td><strong class="icon <?=($i===Yii::app()->dbConfig->superUser) ? 'superUser' : 'normalUser'?>"><?=CHtml::encode($i)?></strong>
                                <?php foreach ($role as $j=>$task): ?>
                        <table class="tasks">
                            <tr>
                                <td>
                                                <?=CHtml::encode($j)?>
                                    <table class="operations">
                                        <tr>
                                            <td valign="top">
                                                            <?php foreach($task as $k=>$operation):?>
                                                                <?=CHtml::encode($k).'<br/>'?>
                                                            <?php endforeach; ?>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                                <?php endforeach; ?>
                    </td>
                </tr>
                    <?php 
                    ++$k;
                    endforeach;
                    ?>
            </table>
        </td>
    </tr>
</table>
<?php else: ?>
<h4><?=Yii::t('crm', 'Sorry!')?></h4>
<p><?=Yii::t('crm', 'Aber das System konnte leider keinen Nutzer mit der ID finden.')?></p>
<?php endif;?>
